<%@page import="com.wanmait.shoppingsys.vo.Address"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.shoppingsys.vo.UserInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:include  page="/AddressController?action=findAll"></jsp:include>
<%
String path = request.getServletContext().getContextPath();	
%>
<jsp:include page="/inc/header.jsp"></jsp:include>
<div class="search_bar clearfix">
		
		<a href="<%=path %>/index.jsp" class="logo fl"><img src="<%=path %>/images/logo.png"></a>
	</div>
<div class="main_con clearfix">
	<%  UserInfo userinfo  =(UserInfo) request.getSession().getAttribute("userinfo"); %>
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="<%=path %>/userinfo/info.jsp">· 个人信息</a></li>
				<li><a href="<%=path %>/GoodsController?action=findAll&id=<%=userinfo.getId() %>">· 全部订单</a></li>
				<li><a href="<%=path %>/userinfo/address.jsp" class="active">· 收货地址</a></li>
			</ul>
		</div>
		<div class="right_content clearfix">
				<h3 class="common_title2">收货地址</h3>
				<div class="site_con">
					<dl>
						<dt>我的地址：</dt>

       <% ArrayList<Address> params =(ArrayList<Address>) request.getAttribute("address");
			
			if(params!=null)
			{
			for(int i=0;i<params.size();i++)
				{
			Address address	 = params.get(i);
			
				%>
				<dd><%=address.getProvince()%><%=address.getCity()%><%=address.getDistrict()%>  <%=address.getSite() %>           (<%=address.getNamea() %>    收)              <%=address.getCpn() %>   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <img class="dot"  data-id="<%=address.getId() %>"   class="bjy" width="70" height="23" src="<%=path %>/images/444.png">  </dd>
				<% 
				}
			}
				%>

</dl>						
				</div>
				
				
				<h3 class="common_title2">添加地址</h3>
				<div class="site_con">
					<form action="<%=path %>/AddressController?action=add&id=<%=userinfo.getId() %>" method="post">
					
						
						  <div data-toggle="distpicker">
						        <div class="form-group1">
						          <label class="sr-only" for="province2"></label>
						          <select class="form-control" name="province" id="province2" data-province="---- 选择省 ----"></select>
						        </div>
						        <div class="form-group11">
						          <label class="sr-only" for="city2"></label>
						          <select class="form-control"  name="city" id="city2" data-city="---- 选择市 ----"></select>
						        </div>
						        <div class="form-group12">
						          <label class="sr-only" for="district2"></label>
						          <select class="form-control" name="district" id="district2" data-district="---- 选择区 ----"></select>
						        </div>
					      </div>
							<div>
							&nbsp;
							</div>
						
							
						
							<div class="form_group">
								<label>收件人：</label>
								<input type="text" name="namea">
							</div>
							<div class="form_group form_group2">
								<label>详细地址：</label>
								<textarea class="site_area" name="site"></textarea>
							</div>
							<div class="form_group">
								<label>手机：</label>
								<input type="text" name="cpn">
							</div>
	
							<input type="submit" name="" value="提交" class="info_submit">
					</form>
				</div>
		</div>
	</div>

<jsp:include page="/inc/footer.jsp"></jsp:include>
<script>

$(".dot").click(function(){
	var that = $(this);//a
	
	var ida = that.data("id");
	
	window.location.href="<%=path %>/AddressController?action=delet&id="+ida;
	
	
});

	
	
</script>


